<!-- 完善接单 -->
<template>
	<view class="mydatumh-box" v-if="form">
		<view class="title">
			完善资料
		</view>
		<view class="tips">
			<view>
				为了帮你提供优质的服务
			</view>
			<view>
				你需要认真填写以下信息，性别不可改变
			</view>
		</view>
		<view class="image-box" @click="openPopup()">
			<image :src="form.head?form.head:avatar">
				<view class="image-tip">
					头像是一个好需求的开始
				</view>
		</view>
		<view class="name-box">
			<input type="text" class="input" placeholder='请输入姓名' placeholder-style='input' v-model="form.name"
				 maxlength='5'>
		</view>
		<view class="gender-box">
			<view class="gender" :style="{background:form.gender==item.type?item.color:'#E0E0E0'}"
				v-for="(item,index) in gender" :key="index" @click="genderClick(item,index)">
				<text class='iconfont fontclassIcon_boy' v-if="index==0"></text><text
					class='iconfont fontclassIcon_gril' v-else></text>{{item.name}}
			</view>
		</view>
		<view class="picker-box">
			<view class="item">
				<picker mode="date" :value="form.date" @change="bindDateChange" end=''>
					<view class="name">出生年份</view>
					<view class="value">
						<view class="uni-input" v-if="form.date_date">{{form.date_date}}</view>
						<view class="uni-input" v-else>请选择</view>
					</view>
				</picker>
			</view>
			<view class="item">
				<picker mode="selector" :value="form.drving" :range="drving_arr" range-key="title"
					@change="drivingChange">
					<view class="name">最高学历</view>
					<view class="value">
						<view class="uni-input" v-if="form.drving">
							{{drving_arr[drving_arr.findIndex((value)=>value.id==form.drving)].title}}</view>
						<view class="uni-input" v-else>请选择</view>
					</view>
				</picker>
			</view>
			<view class="item">
				<picker mode="selector" :value="form.age" :range="age_arr" range-key="title" @change="ageChange">
					<view class="name">工作经验</view>
					<view class="value">
						<view class="uni-input" v-if="form.age">
							{{age_arr[age_arr.findIndex((value)=>value.id==form.age)].title}}</view>
						<view class="uni-input" v-else>请选择</view>
					</view>
				</picker>
			</view>
		</view>
		<view class="submit-box">
			<view class="submit" @click="submit()">
				完成
			</view>
		</view>
		<image-cropper :src="tempFilePath" @confirm="confirm" @cancel="cancel"></image-cropper>
		<uni-popup ref="popup" type="bottom" :safe-area='false'>
			<view class="avatar-box">
				<view class="title">
					选择上传方式
				</view>
				<view class="mode">
					<view class="left-box">
						<view class="left">
							<!-- <ImageCropper :src="tempFilePath" @confirm="confirm" @cancel="cancel" style='width: 100%!important;height: 100%;!important'></ImageCropper> -->
							<text class='iconfont fontclassIcon_Plus' @click="upload"></text>
							
						</view>
						<view>
							我的照片
						</view>
					</view>
					<view class="left-box" @click="getUserAvatar()">
						<view class="left">
							<text class='iconfont fontclassIcon_Plus'></text>
						</view>
						<view>
							默认头像
						</view>
					</view>
				</view>
				<view class="cancel" @click="close()">
					取消
				</view>
			</view>
		</uni-popup>
		<uni-popup ref="avatar" type="bottom" :safe-area='false'>
			<view class="default-box">
				<view class="image-box">
					<image :src="item" v-for="(item,index) in headList" :key="index" @click="choseAvatar(item)"></image>
				</view>
				<view class="cancel" @click="closeAvatar()">
					取消
				</view>
			</view>
			
		</uni-popup>
	</view>
</template>

<script src="./page.js"></script>

<style scoped lang="scss">
	@import 'page.scss';
</style>
